<?php
/**
* Smarty plugin
* @package Smarty
* @subpackage plugins
*/

/**
* Smarty {css_optimizer} function plugin
*
* Type: function<br>
* Name: css_optimizer<br>
* Purpose: Optimize CSS-file
* @author Oleg Cherniy <oleg dot cherniy at gmail dot com>
* @param array
* @param Smarty
* @return string
*/

function smarty_function_css_optimizer($params, &$smarty)
{
    $file = $params['css_file'];
    unset($params['css_file']);
    $cssOptimizer = new CssOptimizer($params);
    $cssOptimizer->optimize($file);

    return $cssOptimizer->getCssFileName();
}

/* vim: set expandtab: */

?>